import 'package:flutter/material.dart';

class AloneTitle extends StatelessWidget {
  final Widget? child;
  final Color? focusColor;
  final double thickness;
  final EdgeInsetsGeometry? margin;
  final EdgeInsetsGeometry? padding;

  const AloneTitle({
    Key? key,
    this.focusColor,
    this.margin = const EdgeInsets.only(
      top: 10,
      left: 15,
      right: 15,
    ),
    this.padding = const EdgeInsets.only(
      left: 10,
    ),
    this.child,
    this.thickness = 4,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final borderColor = focusColor ?? Theme.of(context).colorScheme.primary;
    return Container(
      margin: margin,
      decoration: BoxDecoration(
        border: Border(
          left: BorderSide(color: borderColor, width: thickness),
        ),
      ),
      padding: padding,
      alignment: Alignment.centerLeft,
      child: child,
    );
  }
}
